/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-7-5
*
\*********************************************************************/

#include "DisPlayContent.h"
#include "DisplayControl.h"
#include "CamControl.h"
#include "CamGainControl.h"
#include "ProtocolMCU.h"
#include "ImageDetect.h"
#include "FocusControl.h"


int DisPlayContent::camGain() const
{
//    return 59;
    return CamGainControl::GetInstance().GetGain();
}

int DisPlayContent::camFocus() const
{
    return focusCtl.GetFocus();
}

float DisPlayContent::viewField() const
{
    return focusCtl.GetViewField();
}

int DisPlayContent::contrast() const
{
    return GetContrast();
}

QString DisPlayContent::outModeStr() const
{
    OutMode mode = GetOutMode();
    QString str;
    if(mode == OutMode::ORIGINAL)
    {
        str = "原图输出";
    }
    else if(mode == OutMode::ENHANCE)
    {
        str = "增强输出";
    }
    else
    {
        str = "信息叠加";
    }
    return str;
}

QString DisPlayContent::workModeStr() const
{
    return (CamControl::GetInstance().GetWorkMode()?"正在工作":"待机");
}

QString DisPlayContent::videoRecordSateStr() const
{
    return (CamControl::GetInstance().GetVideoRecordSate()?"正在录制":"停止录制");
}

bool DisPlayContent::crossState() const
{
    return GetCrossMode();
}

float DisPlayContent::softVersion() const
{
    return 1.55;
}

int DisPlayContent::outModeInt() const
{
    return static_cast<int>(GetOutMode());
}

QString DisPlayContent::showInf() const
{
    auto points = ImageDetect::GetInstance().GetObjectPoints();
    unsigned int num = points.size();
    char destStr[1024];
    memset(destStr,0,sizeof(destStr));
    sprintf(destStr,"Target number: %d\n",num);
    for(unsigned int i=0;i<num;i++)
    {
        char str[50];
        memset(str,0,sizeof(str));
        sprintf(str,"Target %d u:%.2f v:%.2f\n",i+1, points.at(i).x, points.at(i).y);
        strcat (destStr,str);
    }
    return destStr;
}

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
